﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    class Demo01
    {
        private int length;
        private int width;
        private double radius;

        public int Length
        {
            get { return this.length; }
            set { length = value; }
        }

        public int Width
        {
            get { return this.width; }
            set { width = value; }
        }

        public double Radius
        {
            get { return this.radius; }
            set { radius = value; }
        }

        /// <summary>
        /// 计算长方形的面积
        /// </summary>
        /// <param name="length">长方形的长</param>
        /// <param name="width">长方形的宽</param>
        /// <returns>长方形的面积</returns>
        public int GetArea(int length, int width)
        {
            return length * width;
        }

        /// <summary>
        /// 计算圆的面积
        /// </summary>
        /// <param name="radius">圆的半径</param>
        /// <returns>圆的面积</returns>
        public double GetArea(int radius)
        {
            return radius * radius * 3.14;
        }
    }
}
